package org.pzy.java.reactor;

import java.util.Observable;
import java.util.Observer;

/**
 * @Author: DRevelation
 * @Date: 2023/5/30 14:22
 */
public class ObserverDemo extends Observable {
    public static void main(String[] args) {
        ObserverDemo demo=new ObserverDemo();
        demo.addObserver((o, arg) -> System.out.println("数据发生变化A"));
        demo.addObserver((o, arg) -> System.out.println("数据发生变化B"));

        demo.setChanged();
        demo.notifyObservers();
    }
}
